package com.central.gateway.feign.fallback;

import com.central.gateway.feign.SysUserAccountService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * menuService降级工场
 */
@Slf4j
@Component
public class SysUserAccountServiceFallbackFactory implements FallbackFactory<SysUserAccountService> {

    @Override
    public SysUserAccountService create(Throwable throwable) {
        return username -> {
            log.error("调用isSupperAdminUser异常：{}", username, throwable);
            return false;
        };
    }
}
